<?php 
namespace ListMenu\Model;

class ListMenu
{
	public $ID_M;
	public $ID_SUB_M;	
	public $LABEL_M;
	public $ROUTE_M;
	public $TYPE_M;
	public $ISSUB_M;
	public $ACTIVE_M;

	public $name_menu;
	public $activemenu;
	public $select_menu;
	public $menus;
	public $router_menu;
	public $hidden_menu;
	
	public function exchangeArray($data)
	{
		$this->ID_M     = (!empty($data['ID_M'])) ? $data['ID_M'] : null;
		$this->ID_SUB_M = (!empty($data['ID_SUB_M'])) ? $data['ID_SUB_M'] : null;	
		$this->LABEL_M = (!empty($data['LABEL_M'])) ? $data['LABEL_M'] : null;
		$this->ROUTE_M     = (!empty($data['ROUTE_M'])) ? $data['ROUTE_M'] : null;
		$this->TYPE_M = (!empty($data['TYPE_M'])) ? $data['TYPE_M'] : null;
		$this->ISSUB_M = (!empty($data['ISSUB_M'])) ? $data['ISSUB_M'] : null;
		$this->ACTIVE_M = (!empty($data['ACTIVE_M'])) ? $data['ACTIVE_M'] : null;
	}
	
	// Add the following method:
	public function getArrayCopy()
	{
		return get_object_vars($this);
	}
	
	
	public function addArray($data)
	{
		$this->name_menu = (!empty($data['name_menu'])) ? $data['name_menu'] : null;
		$this->activemenu = (!empty($data['activemenu'])) ? $data['activemenu'] : null;
		$this->select_menu = (!empty($data['select_menu'])) ? $data['select_menu'] : null;		
		$this->menus = (!empty($data['menus'])) ? $data['menus'] : null;
		$this->router_menu = (!empty($data['router_menu'])) ? $data['router_menu'] : null;
		$this->hidden_menu = (!empty($data['hidden_menu'])) ? $data['hidden_menu'] : null;
	}
}